from scrapy_plus.core.spider import Spider

from scrapy_plus.https.request import Request

from scrapy_plus.item import Item
import time


class BaiduSpider(Spider):
    name = 'baidu'
    start_urls = ['https://www.so.cn']
    # 定时爬虫
    timed_task = True

    def start_requests(self):
        while True:
            for url in self.start_urls:
                yield Request(url, parse='parse', filter=False)
                time.sleep(3)

    def parse(self, response):
        print(response.url)
        yield Item(response.url)




